package random;

import java.util.Random;

public class RandomDemo {
	public static void main(String[] args) {
		/*Random rd = new Random(); // 创建一个Random对象
		for (int i = 0; i < 20; i++){ // 随机生成20个随机数
			int num = rd.nextInt(10); // 返回下一个伪随机数，整型的
			System.out.println("第" + (i+1) + "个随机数是：" + num);
		}*/
		
		Random rd = new Random(10);
		int num = rd.nextInt();
		System.out.println(num);
		Random rd1 = new Random(10);
		int num1 = rd1.nextInt();
		System.out.println(num1);
	}

}
